<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <ui:include src="/WEB-INF/frags/header.xhtml"/>
        <link rel="stylesheet" type="text/css" href="resources/css/styles.css"/>
    </h:head>
    <h:body id="body">
        <h:form id="frmPrincipal">

            <p:growl id="messages"/>

            <ui:include src="/WEB-INF/frags/redirect.xhtml"/>

            <p:layout id="Layout" fullPage="true" rendered="#{loginBean.usuario.profiles.prfMenuExit}">

                <p:layoutUnit position="north" size="50" resizable="false"> 

                    <h:outputText value="Bienvenido #{loginBean.usuario.usrName} #{loginBean.usuario.usrLstn}" 
                                  style="font-size: 20px; position: fixed; top: 10px; left: 10px;"/> 

                    <h:outputText value="#{loginBean.usuario.profiles.prfName}" 
                                  style="position: fixed; top: 30px; left: 10px;"/>

                    <p:splitButton value="Tomar Turno" 
                                   actionListener="#{turnsBean.askTurn()}"
                                   oncomplete="dlgNewTurn.show();"
                                   update=":frmNewTurn:lblCurrentTurn" 
                                   icon="ui-icon-star" >  

                        <p:menuitem value="Cerrar Sesión" 
                                    actionListener="#{loginBean.logout()}" 
                                    icon="ui-icon-exit" />

                    </p:splitButton>  

                </p:layoutUnit>  

                <p:layoutUnit position="west" 
                              size="auto" 
                              header="Menú Principal">  

                    <p:panelMenu style="width: 200px;"> 

                        <p:submenu label="Mantenimiento" 
                                   rendered="#{loginBean.usuario.profiles.prfMenuMngm}">

                            <p:menuitem value="Usuarios" 
                                        actionListener="#{navigationBean.mngmUsers()}" 
                                        ajax="false"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmUser}"/>
                            <p:menuitem value="Perfiles" 
                                        actionListener="#{navigationBean.mngmProf()}"
                                        ajax="false"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmProf}"/>
                            <p:menuitem value="Estudiantes" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmStdn}"/>
                            <p:menuitem value="Niveles de Formaci&oacute;n" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmLvls}"/>
                            <p:menuitem value="Facultades" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmFclt}"/>  
                            <p:menuitem value="Programas" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuMngmProg}"/>  
                        </p:submenu>

                        <p:submenu label="Imprimir" 
                                   rendered="#{loginBean.usuario.profiles.prfMenuImpr}">  

                            <p:menuitem value="Liquidaci&oacute;n" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuImprLiqn}"/>
                            <p:menuitem value="Certificado" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuImprCrtf}"/>

                        </p:submenu>

                        <p:submenu label="Herramientas" 
                                   rendered="#{loginBean.usuario.profiles.prfMenuTool}">

                            <p:menuitem value="Actualizar Contrase&ntilde;a" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuToolPswc}"/>

                            <p:menuitem value="Realizar copia de seguridad" 
                                        actionListener="#"
                                        update="mainPannel"
                                        rendered="#{loginBean.usuario.profiles.prfMenuToolBckp}"/>
                        </p:submenu>

                    </p:panelMenu>

                </p:layoutUnit>

                <p:layoutUnit position="center">  

                    <p:panel id="mainPannel"  
                             style="height: 99%; width: auto; border: none;">

                        <ui:include src="#{navigationBean.xhtml}"/>

                    </p:panel>

                </p:layoutUnit>  


                <p:layoutUnit position="south" size="20">  
                    <ui:include src="/WEB-INF/frags/footer.xhtml"/>
                </p:layoutUnit> 

            </p:layout>

        </h:form>

        <ui:include src="/WEB-INF/frags/dialogs.xhtml"/>

    </h:body>
</html>

